# encoding:utf8
def translate(ups_status):
    status_list = [
        {0: u"", 1: u""},
        {0: u"", 1: u"关机,"},
        {0: u"", 1: u"测试进行中,"},
        {0: u"在线式,", 1: u"后备式,"},
        {0: u"", 1: u"故障,"},
        {0: u"", 1: u"旁路模式,"},
        {0: u"", 1: u"电池电压低,"},
        {0: u"", 1: u"市电异常,"}]
    status = u""
    tmp = 1
    for i in range(8):
        status += status_list[i][ups_status & tmp]
        ups_status = ups_status >> 1
    return status


def main():
    ups_list = [0, 2, 4, 8, 16, 32, 64, 128]
    for i in range(256):
        print i
        print(translate(i))

if __name__ == '__main__':
    main()
